from django.http import Http404

def delete_slug(model, request):
    if not request.POST:
        raise Http404
    slug = request.POST.get('slug')
    if not slug:
        raise Http404
    model.objects.get(slug=slug).delete()
